<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class AggregateFixReport extends Model
{
    use HasFactory, SoftDeletes;

    protected $casts = [
        'data' => 'json',
    ];

    protected $fillable = [
        'operator_id',
        'sheet_template_id',
        'frequency',
        'year',
        'key',
        'data',
    ];

    public function sheetTemplate()
    {
        return $this->belongsTo(SheetTemplate::class)->select('id', 'name', 'type');
    }
}
